package cn.codenest.listener;

import com.rabbitmq.client.AMQP;
import com.rabbitmq.client.ReturnListener;

import java.io.IOException;

/**
 * @author ：Hyman
 * @date ：Created in 2021/7/13 11:07
 * @description：
 * @modified By：
 * @version: $
 */
public class MyReturnListener implements ReturnListener {
    @Override
    public void handleReturn(int replyCode, String replyText,
                             String exchange, String routingKey,
                             AMQP.BasicProperties properties, byte[] body) throws IOException {
        System.out.println("以下消息不可达");
        System.out.println("replyCode: " + replyCode);
        System.out.println("replyText: " + replyText);
        System.out.println("exchange: " + exchange);
        System.out.println("routingKey: " + routingKey);
        System.out.println("properties: " + properties);
        System.out.println("body: " + new String(body));
    }
}
